package common;

/**
 * 响应结果
 */
public class Result {
    /**
     * 消息
     */
    private String message;
    /**
     * 数据
     */
    private  Object data;
    /**
     * 代码 200 500
     */
    private  Integer code;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }



    public Result(String message, Object data, Integer code) {
        this.message = message;
        this.data = data;
        this.code = code;
    }


    public  static Result ok (String message ,Object data){
        return  new Result(message ,data,200);
    }
    public  static Result fail (String message ,Object data){
        return  new Result(message ,data,500);
    }







}
